<template>
  <div class="treatment-process">
    <div class="treatment-process_content">
      <el-card class="box-card">
        <div slot="header" class="clearfix">
          <span>发病至到达医院大门时间</span>
          <el-popover placement="bottom" title="说明" width="400" trigger="hover">
            <div>考核对象：</div>
            <div>非院内发病病例</div>
            <div>数据取值：</div>
            <div>1.“本院急救车、当地120、自行来院”的病例，取“入院信息”中“到达医院大门时间”与“发病时间”的差值；</div>
            <div>2.“外院转院”的病例，取“入院信息”中“到达医院大门”与“发病时间”的差值</div>
            <div>3.按月统计，1个病例计1例，无重复计算，计算公式中一个或两个时间点未填写的病例不计</div>
            <div>查询筛选：</div>
            <div>时间-年份、季度、月份；</div>
            <div>默认显示本年</div>
            <i slot="reference" class="el-icon-info" style="color: #42cece;" />
          </el-popover>
        </div>
        <div class="dignosis-content" style="position: relative;">
          <div style="position: absolute; left: 47%; top: -1%;line-height: 36px; z-index: 999;" />
          <div id="getDot" class="treatment-process-card" />
        </div>
      </el-card>
      <el-card v-show="!doc" class="box-card">
        <div slot="header" class="clearfix">
          <span>到达医院大门至接诊时间</span>
          <el-popover placement="bottom" title="说明" width="400" trigger="hover" style="margin-left: 5px;">
            <div>考核对象：</div>
            <div>非院内发病病例</div>
            <div>数据取值：</div>
            <div>1.“本院急救车、当地120、自行来院”的病例，取“入院信息”中“到达医院大门时间”与“院内首诊医师接诊时间”的差值；</div>
            <div>2.“外院转院”的病例，取“入院信息”中“到达医院大门”与“院内接诊时间”的差值</div>
            <div>3.按月统计，1个病例计1例，无重复计算，计算公式中一个或两个时间点未填写的病例不计</div>
            <div>查询筛选：</div>
            <div>时间-年份、季度、月份；</div>
            <div>默认显示本年</div>
            <i slot="reference" class="el-icon-info" style="color: #42cece;" />
          </el-popover>
        </div>
        <div id="get-D2Adm" class="treatment-process-card" />
      </el-card>
      <el-card v-show="!doc" class="box-card">
        <div slot="header" class="clearfix">
          <span>到达医院大门至首次入院NIHSS评分时间</span>
          <el-popover placement="bottom" title="说明" width="400" trigger="hover" style="margin-left: 5px;">
            <div>考核对象：</div>
            <div>非院内发病病例</div>
            <div>数据取值：</div>
            <div>1.“本院急救车、当地120、自行来院”的病例，取“入院信息”中“到大医院大门时间”与“NIHSS评分”中系统记录的首次填写“入院NIHSS评分”时间的差值；</div>
            <div>2.“外院转院”的病例，取“入院信息”中“到达医院大门”与“NIHSS评分”中系统记录的首次填写“入院NIHSS评分”时间的差值</div>
            <div>3.按月统计，1个病例计1例，无重复计算，计算公式中一个或两个时间点未填写的病例不计</div>
            <div>查询筛选：</div>
            <div>时间-年份、季度、月份；</div>
            <div>默认显示本年</div>
            <i slot="reference" class="el-icon-info" style="color: #42cece;" />
          </el-popover>
        </div>
        <div id="get-D2FNT" class="treatment-process-card" />
      </el-card>
      <el-card v-show="!doc" class="box-card">
        <div slot="header" class="clearfix">
          <span>到达医院大门至抽血完成平均时间</span>
          <el-popover placement="bottom" title="说明" width="400" trigger="hover" style="margin-left: 5px;">
            <div>考核对象：</div>
            <div>非院内发病病例</div>
            <div>数据取值：</div>
            <div>1.“本院急救车、当地120、自行来院”的病例，取“入院信息”中“到大医院大门时间”与“血液检查”中各项检查“抽血完成时间”的差值；</div>
            <div>2.“外院转院”的病例，取“入院信息”中“到达医院大门”与“血液检查”中各项检查“抽血完成时间”的差值</div>
            <div>3.如果各项检查存在多个时间，取最早的一个</div>
            <div>4.按月统计，1个病例计1例，无重复计算，计算公式中一个或两个时间点未填写的病例不计</div>
            <div>查询筛选：</div>
            <div>时间-年份、季度、月份；</div>
            <div>默认显示本年</div>
            <i slot="reference" class="el-icon-info" style="color: #42cece;" />
          </el-popover>
        </div>
        <div id="getD2SampleTime" class="treatment-process-card" />
      </el-card>
      <el-card v-show="!doc" class="box-card">
        <div slot="header" class="clearfix">
          <span>抽血完成时间至血常规结果平均时间</span>
          <el-popover placement="bottom" title="说明" width="400" trigger="hover" style="margin-left: 5px;">
            <div>考核对象：</div>
            <div>所有卒中病例</div>
            <div>数据取值：</div>
            <div>1.取“血液检查”中，“血常规”的“抽血完成时间”与“结果时间”的差值；</div>
            <div>2.按月统计，1个病例计1例，无重复计算，计算公式中一个或两个时间点未填写的病例不计</div>
            <div>查询筛选：</div>
            <div>时间-年份、季度、月份；</div>
            <div>默认显示本年</div>
            <i slot="reference" class="el-icon-info" style="color: #42cece;" />
          </el-popover>
        </div>
        <div id="getSample2BloodReportTime" class="treatment-process-card" />
      </el-card>
      <el-card v-show="!doc" class="box-card">
        <div slot="header" class="clearfix">
          <span>抽血完成时间至凝血功能结果平均时间</span>
          <el-popover placement="bottom" title="说明" width="400" trigger="hover" style="margin-left: 5px;">
            <div>考核对象：</div>
            <div>所有卒中病例</div>
            <div>数据取值：</div>
            <div>1.取“血液检查”中，“凝血功能”的“抽血完成时间”与“结果时间”的差值；</div>
            <div>2.按月统计，1个病例计1例，无重复计算，计算公式中一个或两个时间点未填写的病例不计</div>
            <div>查询筛选：</div>
            <div>时间-年份、季度、月份；</div>
            <div>默认显示本年</div>
            <i slot="reference" class="el-icon-info" style="color: #42cece;" />
          </el-popover>
        </div>
        <div id="getSample2CoagulReportTime" class="treatment-process-card" />
      </el-card>
      <el-card v-show="!doc" class="box-card">
        <div slot="header" class="clearfix">
          <span>到达医院大门至CT报告时间</span>
          <el-popover placement="bottom" title="说明" width="400" trigger="hover" style="margin-left: 5px;">
            <div>考核对象：</div>
            <div>非院内发病病例</div>
            <div>数据取值：</div>
            <div>1.“本院急救车、当地120、自行来院”的病例，取“入院信息”中“到大医院大门时间”与“辅助检查”中“CT”的“CT-报告时间”的差值；</div>
            <div>2.“外院转院”的病例，取“入院信息”中“到达医院大门”与“辅助检查”中“CT”的“CT-报告时间”的差值</div>
            <div>3.按月统计，1个病例计1例，无重复计算，计算公式中一个或两个时间点未填写的病例不计</div>
            <div>查询筛选：</div>
            <div>时间-年份、季度、月份；</div>
            <div>默认显示本年</div>
            <i slot="reference" class="el-icon-info" style="color: #42cece;" />
          </el-popover>
        </div>
        <div id="getD2CTReportTime" class="treatment-process-card" />
      </el-card>
      <el-card v-show="!doc" class="box-card">
        <div slot="header" class="clearfix">
          <span>溶栓谈话至溶栓签字平均时间</span>
          <el-popover placement="bottom" title="说明" width="400" trigger="hover" style="margin-left: 5px;">
            <div>考核对象：</div>
            <div>所有卒中病例</div>
            <div>数据取值：</div>
            <div>1.取“溶栓知情同意书”中“溶栓谈话”与“签署知情同意书时间”的差值；</div>
            <div>2.按月统计，1个病例计1例，无重复计算，计算公式中一个或两个时间点未填写的病例不计</div>
            <div>查询筛选：</div>
            <div>时间-年份、季度、月份；</div>
            <div>默认显示本年"</div>
            <i slot="reference" class="el-icon-info" style="color: #42cece;" />
          </el-popover>
        </div>
        <div id="getThromTalk2SignTime" class="treatment-process-card" />
      </el-card>
      <el-card v-show="!doc" class="box-card">
        <div slot="header" class="clearfix">
          <span>CT报告至开始静脉溶栓时间</span>
          <el-popover placement="bottom" title="说明" width="400" trigger="hover" style="margin-left: 5px;">
            <div>考核对象：</div>
            <div>所有卒中病例</div>
            <div>数据取值：</div>
            <div>1.取“辅助检查”中“CT”的“CT-报告时间”与“溶栓治疗”中“开始静脉溶栓时间”的差值；</div>
            <div>2.按月统计，1个病例计1例，无重复计算，计算公式中一个或两个时间点未填写的病例不计</div>
            <div>查询筛选：</div>
            <div>时间-年份、季度、月份；</div>
            <div>默认显示本年</div>
            <i slot="reference" class="el-icon-info" style="color: #42cece;" />
          </el-popover>
        </div>
        <div id="getCTReport2ThromTime" class="treatment-process-card" />
      </el-card>

      <el-card v-show="!doc" class="box-card">
        <div slot="header" class="clearfix">
          <span>到院至首次血管再通时间（DRT）</span>
          <el-popover placement="bottom" title="说明" width="400" trigger="hover" style="margin-left: 5px;">
            <div>考核对象：</div>
            <div>所有卒中病例</div>
            <div>数据取值：</div>
            <div>1.“本院急救车、当地120、自行来院”的病例，取“入院信息”中“到达医院大门时间”与“介入治疗”中“首次血管再通时间”的差值；</div>
            <div>2.“外院转院”的病例，取“入院信息”中“到达医院大门”与“介入治疗”中“首次血管再通时间”的差值</div>
            <div>3.按月统计，1个病例计1例，无重复计算，计算公式中一个或两个时间点未填写的病例不计</div>
            <div>查询筛选：</div>
            <div>时间-年份、季度、月份；</div>
            <div>默认显示本年</div>
            <i slot="reference" class="el-icon-info" style="color: #42cece;" />
          </el-popover>
        </div>
        <div id="getDRT" class="treatment-process-card" />
      </el-card>
      <el-card v-show="!doc" class="box-card">
        <div slot="header" class="clearfix">
          <span>技术开展情况</span>
        </div>
        <div class="dignosis-content" style="position: relative;">
          <div style="position: absolute; left: 45%; top: -1%;line-height: 36px; z-index: 999;">
            <span
              style="height: 20px; line-height: 20px; font-weight: bold; font-size: 20px; display: inline-block;"
            >主要治疗操作（总计：{{
              sum_subtotalSurgeryNum
            }}例）</span>
            <el-popover placement="bottom" title="说明" width="400" trigger="hover">
              <div>考核对象：</div>
              <div>所有卒中病例</div>
              <div>数据取值：</div>
              <div>
                1.各项手术填写手术时间计1例，填写“溶栓治疗-开始静脉溶栓时间”计为“静脉溶栓例数”、填写“介入治疗-介入手术开始时间”计为“血管内治疗例数”、填写“手术治疗-脑出血手术开始时间”计为“脑出血手术例数”，填写“手术治疗-动脉瘤-手术时间”计为“颅内动脉瘤手术例数”，填写“手术治疗-CEA/CAS-CEA/CAS手术开始时间”计为“CEA/CAS手术例数”
              </div>
              <div>2.按月统计，1个病例可能存在1个以上治疗类型，有重复计算可能</div>
              <div>查询筛选：</div>
              <div>时间-年份、季度、月份；</div>
              <div>全院、科室</div>
              <div>默认显示本年</div>
              <i slot="reference" class="el-icon-info" style="color: #42cece;" />
            </el-popover>
          </div>
          <div id="getSurgeryNum" style="width: 100%; height: 100%;" />
        </div>
        <div class="dignosis-content" style="position: relative;">
          <div style="position: absolute; left: 35%; top: -1%;line-height: 36px; z-index: 999;">
            <span
              style="height: 20px; line-height: 20px; font-weight: bold; font-size: 20px; display: inline-block;"
            >CEA/CAS手术采取方式（总计：{{
              sum_casCea }}例
              全年CAS/CEA的比值（P）={{ ratioCasCea }}）</span>
            <el-popover placement="bottom" title="说明" width="400" trigger="hover">
              <div>考核对象：</div>
              <div>颈动脉狭窄或闭塞病例</div>
              <div>数据取值：</div>
              <div>1.取“手术治疗”中“CEA/CAS”的“手术采取方式”中“标准式CEA、外翻式CEA、CAS、复合手术”的例数；</div>
              <div>2. 全年CAS/CEA的比值（P）计算方法：复合手术除外，CEA=标准式CEA+外翻式CEA，计算CAS与CEA的比值，除不尽取小数点后2位四舍五入；</div>
              <div>3.按月统计，1个病例计1例，无重复计算</div>
              <div>查询筛选：</div>
              <div>时间-年份、季度、月份；</div>
              <div>默认显示本年</div>
              <i slot="reference" class="el-icon-info" style="color: #42cece;" />
            </el-popover>
          </div>
          <div id="getCeaCasSurgeryModeNum" style="width: 100%; height: 100%;" />
        </div>
        <div class="dignosis-content" style="position: relative;">
          <div style="position: relative;left: 30.5%;">总计:{{ sum_noThromReasonNum }}例</div>
          <div style="position: absolute; left: 45%; top: -1%;line-height: 36px; z-index: 999;">
            <span
              style="height: 20px; line-height: 20px; font-weight: bold; font-size: 20px; display: inline-block;"
            >未溶栓原因</span>
            <el-popover placement="bottom" title="说明" width="400" trigger="hover">
              <div>考核对象：</div>
              <div>脑梗死病例</div>
              <div>数据取值：</div>
              <div>1.取“未给予溶栓原因”，未填写不计；</div>
              <div>2.统计每类原因（超时间窗、禁忌症、患者/家属拒绝/外院溶栓）的病例数量；</div>
              <div>3.计算占比，占比=该原因病例数量/已填写原因的总病例数量</div>
              <div>4.按月统计，1个病例计1例，无重复计算</div>
              <div>查询筛选：</div>
              <div>时间-年份、季度、月份；</div>
              <div>默认显示本年</div>
              <i slot="reference" class="el-icon-info" style="color: #42cece;" />
            </el-popover>
          </div>
          <div id="getNoThromReasonNum" style="width: 100%; height: 100%;" />
        </div>
        <div class="dignosis-content" style="position: relative;">
          <div style="position: relative;left: 30.5%;">总计:{{ sum_noIntervReasonNum }}例</div>
          <div style="position: absolute; left: 45%; top: -1%;line-height: 36px; z-index: 999;">
            <span
              style="height: 20px; line-height: 20px; font-weight: bold; font-size: 20px; display: inline-block;"
            >未给予血管内治疗原因</span>
            <el-popover placement="bottom" title="说明" width="400" trigger="hover">
              <div>考核对象：</div>
              <div>脑梗死病例</div>
              <div>数据取值：</div>
              <div>1.取“未给予血管内治疗的原因”，未填写不计；</div>
              <div>2.统计每类原因（超时间窗、禁忌症、患者/家属拒绝/非大血管病变）的病例数量；</div>
              <div>3.计算占比，占比=该原因病例数量/已填写原因的总病例数量</div>
              <div>4.按月统计，1个病例计2例，无重复计算</div>
              <div>查询筛选：</div>
              <div>时间-年份、季度、月份；</div>
              <div>默认显示本年</div>
              <i slot="reference" class="el-icon-info" style="color: #42cece;" />
            </el-popover>
          </div>
          <div id="getNoIntervReasonNum" style="width: 100%; height: 100%;" />
        </div>
      </el-card>
    </div>
  </div>
</template>
<script>

import echarts from 'echarts'
import {
  getODT,
  getD2Adm,
  getD2FNT,
  getD2SampleTime,
  getSample2BloodReportTime,
  getSample2CoagulReportTime,
  getD2CTReportTime,
  getThromTalk2SignTime,
  getCTReport2ThromTime,
  getDRT,
  getSurgeryNum,
  getCeaCasSurgeryModeNum,
  getNoThromReasonNum,
  getNoIntervReasonNum
} from '@/api/statistical/statisticStroke'
export default {
  props: ['preYear', 'preQuarter', 'preMonth', 'preMonthRange', 'preDept', 'preDoc'],
  data() {
    return {
      radioDate: '1',
      year: '',
      quarter: '',
      month: '',
      dept: '',
      doc: '',
      monthRange: [],
      sum_subtotalSurgeryNum: 0,
      sum_casCea: 0,
      ratioCasCea: 0,
      sum_noIntervReasonNum: 0,
      sum_noThromReasonNum: 0
    }
  },
  mounted() {},
  methods: {
    search() {
      this.year = this.preYear
      this.quarter = this.preQuarter
      this.month = this.preMonth
      this.monthRange = this.preMonthRange
      this.dept = this.preDept
      this.doc = this.preDoc
      this.initApi()
    },
    initApi() {
      this.StrokeGetODT()
      this.StrokeGetD2Adm()
      this.StrokeGetD2FNT()
      this.StrokeGetD2SampleTime()
      this.StrokeGetSample2BloodReportTime()
      this.StrokeGetSample2CoagulReportTime()
      this.StrokeGetD2CTReportTime()
      this.StrokeGetThromTalk2SignTime()
      this.StrokeGetCTReport2ThromTime()
      this.StrokeGetDRT()
      this.StrokeGetSurgeryNum()
      this.StrokeGetCeaCasSurgeryModeNum()
      this.StrokeGetNoThromReasonNum()
      this.StrokeGetNoIntervReasonNum()
    },
    notHaveData(chart) {
      chart.showLoading({
        text: '暂无数据',
        fontSize: 18,
        left: 'center',
        color: 'transparent', // loading颜色，设置成透明或白色，不然会显示loading状态
        textColor: '#000', // 文字颜色
        maskColor: 'rgba(255, 255, 255, 0)' // 背景色
      })
    },
    StrokeGetODT() {
      const chartDom = document.getElementById('getDot')
      const myChart = echarts.init(chartDom)
      myChart.clear()
      myChart.hideLoading()
      window.addEventListener('resize', myChart.resize)
      getODT({
        hospitalId: this.$store.getters.hospitalId,
        year: this.year,
        quarter: this.quarter,
        month: this.month,
        startTime: this.monthRange.length > 0 ? this.monthRange[0] : '',
        endTime: this.monthRange.length > 0 ? this.monthRange[1] : '',
        departmentName: this.dept,
        doctorName: this.doc
      }).then(res => {
        if (res.code !== 0) {
          this.notHaveData(myChart)
          return
        }
        console.log(res)
        if (res.data) {
          const timeLine = []
          const avgQuotaMinute = []
          if (res.data.AvgQuotaMinutes && res.data.AvgQuotaMinutes.length !== 0) {
            res.data.AvgQuotaMinutes.forEach(el => {
              timeLine.push(el.year + '-' + el.month)
              avgQuotaMinute.push(Math.abs(el.avgQuotaMinute))
            })
            const option = {
              color: ['#027DB4'],
              title: {
                text: '',
                subtext: '',
                left: 'center'
              },
              tooltip: {
                trigger: 'axis',
                axisPointer: {
                  type: 'shadow'
                }
              },
              legend: {
                show: false
              },
              xAxis: {
                type: 'category',
                axisTick: {
                  alignWithLabel: true
                },
                data: timeLine
              },
              yAxis: {
                name: '分钟',
                type: 'value'
              },
              series: [{
                // name: '总数',
                type: 'bar',
                barWidth: 20,
                label: {
                  show: true,
                  position: 'top'
                },
                data: avgQuotaMinute
              }]
            }
            myChart.setOption(option)
          } else {
            myChart.showLoading({
              text: '暂无数据',
              fontSize: 18,
              left: 'center',
              color: 'transparent', // loading颜色，设置成透明或白色，不然会显示loading状态
              textColor: '#000', // 文字颜色
              maskColor: 'rgba(255, 255, 255, 0)' // 背景色
            })
          }
        }
      })
    },
    StrokeGetD2Adm() {
      const chartDom = document.getElementById('get-D2Adm')
      const myChart = echarts.init(chartDom)
      myChart.clear()
      myChart.hideLoading()
      window.addEventListener('resize', myChart.resize)
      getD2Adm({
        hospitalId: this.$store.getters.hospitalId,
        year: this.year,
        quarter: this.quarter,
        month: this.month,
        startTime: this.monthRange.length > 0 ? this.monthRange[0] : '',
        endTime: this.monthRange.length > 0 ? this.monthRange[1] : '',
        departmentName: this.dept,
        doctorName: this.doc
      }).then(res => {
        if (res.code !== 0) {
          this.notHaveData(myChart)
          return
        }
        console.log(res)
        if (res.data) {
          const timeLine = []
          const avgQuotaMinute = []
          if (res.data.AvgQuotaMinutes && res.data.AvgQuotaMinutes.length !== 0) {
            res.data.AvgQuotaMinutes.forEach(el => {
              timeLine.push(el.year + '-' + el.month)
              avgQuotaMinute.push(Math.abs(el.avgQuotaMinute))
            })
            const option = {
              color: ['#027DB4'],
              title: {
                text: '',
                subtext: '',
                left: 'center'
              },
              tooltip: {
                trigger: 'axis',
                axisPointer: {
                  type: 'shadow'
                }
              },
              legend: {
                show: false
              },
              xAxis: {
                type: 'category',
                axisTick: {
                  alignWithLabel: true
                },
                data: timeLine
              },
              yAxis: {
                name: '分钟',
                type: 'value'
              },
              series: [{
                // name: '总数',
                type: 'bar',
                barWidth: 20,
                label: {
                  show: true,
                  position: 'top'
                },
                data: avgQuotaMinute
              }]
            }
            myChart.setOption(option)
          } else {
            myChart.showLoading({
              text: '暂无数据',
              fontSize: 18,
              left: 'center',
              color: 'transparent', // loading颜色，设置成透明或白色，不然会显示loading状态
              textColor: '#000', // 文字颜色
              maskColor: 'rgba(255, 255, 255, 0)' // 背景色
            })
          }
        }
      })
    },
    StrokeGetD2FNT() {
      const chartDom = document.getElementById('get-D2FNT')
      const myChart = echarts.init(chartDom)
      myChart.clear()
      myChart.hideLoading()
      window.addEventListener('resize', myChart.resize)
      getD2FNT({
        hospitalId: this.$store.getters.hospitalId,
        year: this.year,
        quarter: this.quarter,
        month: this.month,
        startTime: this.monthRange.length > 0 ? this.monthRange[0] : '',
        endTime: this.monthRange.length > 0 ? this.monthRange[1] : '',
        departmentName: this.dept,
        doctorName: this.doc
      }).then(res => {
        if (res.code !== 0) {
          this.notHaveData(myChart)
          return
        }
        console.log(res)
        if (res.data) {
          const timeLine = []
          const avgQuotaMinute = []
          if (res.data.AvgQuotaMinutes && res.data.AvgQuotaMinutes.length !== 0) {
            res.data.AvgQuotaMinutes.forEach(el => {
              timeLine.push(el.year + '-' + el.month)
              avgQuotaMinute.push(el.avgQuotaMinute)
            })
            const option = {
              color: ['#027DB4'],
              title: {
                text: '',
                subtext: '',
                left: 'center'
              },
              tooltip: {
                trigger: 'axis',
                axisPointer: {
                  type: 'shadow'
                }
              },
              legend: {
                show: false
              },
              xAxis: {
                type: 'category',
                axisTick: {
                  alignWithLabel: true
                },
                data: timeLine
              },
              yAxis: {
                name: '分钟',
                type: 'value'
              },
              series: [{
                // name: '总数',
                type: 'bar',
                barWidth: 20,
                label: {
                  show: true,
                  position: 'top'
                },
                data: avgQuotaMinute
              }]
            }
            myChart.setOption(option)
          } else {
            myChart.showLoading({
              text: '暂无数据',
              fontSize: 18,
              left: 'center',
              color: 'transparent', // loading颜色，设置成透明或白色，不然会显示loading状态
              textColor: '#000', // 文字颜色
              maskColor: 'rgba(255, 255, 255, 0)' // 背景色
            })
          }
        }
      })
    },
    StrokeGetD2SampleTime() {
      const chartDom = document.getElementById('getD2SampleTime')
      const myChart = echarts.init(chartDom)
      myChart.clear()
      myChart.hideLoading()
      window.addEventListener('resize', myChart.resize)
      getD2SampleTime({
        hospitalId: this.$store.getters.hospitalId,
        year: this.year,
        quarter: this.quarter,
        month: this.month,
        startTime: this.monthRange.length > 0 ? this.monthRange[0] : '',
        endTime: this.monthRange.length > 0 ? this.monthRange[1] : '',
        departmentName: this.dept,
        doctorName: this.doc
      }).then(res => {
        if (res.code !== 0) {
          this.notHaveData(myChart)
          return
        }
        console.log(res)
        if (res.data) {
          const timeLine = []
          const avgQuotaMinute = []
          if (res.data.AvgQuotaMinutes && res.data.AvgQuotaMinutes.length !== 0) {
            res.data.AvgQuotaMinutes.forEach(el => {
              timeLine.push(el.year + '-' + el.month)
              avgQuotaMinute.push(el.avgQuotaMinute)
            })
            const option = {
              color: ['#027DB4'],
              title: {
                text: '',
                subtext: '',
                left: 'center'
              },
              tooltip: {
                trigger: 'axis',
                axisPointer: {
                  type: 'shadow'
                }
              },
              legend: {
                show: false
              },
              xAxis: {
                type: 'category',
                axisTick: {
                  alignWithLabel: true
                },
                data: timeLine
              },
              yAxis: {
                name: '分钟',
                type: 'value'
              },
              series: [{
                // name: '总数',
                type: 'bar',
                barWidth: 20,
                label: {
                  show: true,
                  position: 'top'
                },
                data: avgQuotaMinute
              }]
            }
            myChart.setOption(option)
          } else {
            myChart.showLoading({
              text: '暂无数据',
              fontSize: 18,
              left: 'center',
              color: 'transparent', // loading颜色，设置成透明或白色，不然会显示loading状态
              textColor: '#000', // 文字颜色
              maskColor: 'rgba(255, 255, 255, 0)' // 背景色
            })
          }
        }
      })
    },
    StrokeGetSample2BloodReportTime() {
      const chartDom = document.getElementById('getSample2BloodReportTime')
      const myChart = echarts.init(chartDom)
      myChart.clear()
      myChart.hideLoading()
      window.addEventListener('resize', myChart.resize)
      getSample2BloodReportTime({
        hospitalId: this.$store.getters.hospitalId,
        year: this.year,
        quarter: this.quarter,
        month: this.month,
        startTime: this.monthRange.length > 0 ? this.monthRange[0] : '',
        endTime: this.monthRange.length > 0 ? this.monthRange[1] : '',
        departmentName: this.dept,
        doctorName: this.doc
      }).then(res => {
        if (res.code !== 0) {
          this.notHaveData(myChart)
          return
        }
        console.log(res)
        if (res.data) {
          const timeLine = []
          const avgQuotaMinute = []
          if (res.data.AvgQuotaMinutes && res.data.AvgQuotaMinutes.length !== 0) {
            res.data.AvgQuotaMinutes.forEach(el => {
              timeLine.push(el.year + '-' + el.month)
              avgQuotaMinute.push(el.avgQuotaMinute)
            })
            const option = {
              color: ['#027DB4'],
              title: {
                text: '',
                subtext: '',
                left: 'center'
              },
              tooltip: {
                trigger: 'axis',
                axisPointer: {
                  type: 'shadow'
                }
              },
              legend: {
                show: false
              },
              xAxis: {
                type: 'category',
                axisTick: {
                  alignWithLabel: true
                },
                data: timeLine
              },
              yAxis: {
                name: '分钟',
                type: 'value'
              },
              series: [{
                // name: '总数',
                type: 'bar',
                barWidth: 20,
                label: {
                  show: true,
                  position: 'top'
                },
                data: avgQuotaMinute
              }]
            }
            myChart.setOption(option)
          } else {
            myChart.showLoading({
              text: '暂无数据',
              fontSize: 18,
              left: 'center',
              color: 'transparent', // loading颜色，设置成透明或白色，不然会显示loading状态
              textColor: '#000', // 文字颜色
              maskColor: 'rgba(255, 255, 255, 0)' // 背景色
            })
          }
        }
      })
    },
    StrokeGetSample2CoagulReportTime() {
      const chartDom = document.getElementById('getSample2CoagulReportTime')
      const myChart = echarts.init(chartDom)
      myChart.clear()
      myChart.hideLoading()
      window.addEventListener('resize', myChart.resize)
      getSample2CoagulReportTime({
        hospitalId: this.$store.getters.hospitalId,
        year: this.year,
        quarter: this.quarter,
        month: this.month,
        startTime: this.monthRange.length > 0 ? this.monthRange[0] : '',
        endTime: this.monthRange.length > 0 ? this.monthRange[1] : '',
        departmentName: this.dept,
        doctorName: this.doc
      }).then(res => {
        if (res.code !== 0) {
          this.notHaveData(myChart)
          return
        }
        console.log(res)
        if (res.data) {
          const timeLine = []
          const avgQuotaMinute = []
          if (res.data.AvgQuotaMinutes && res.data.AvgQuotaMinutes.length !== 0) {
            res.data.AvgQuotaMinutes.forEach(el => {
              timeLine.push(el.year + '-' + el.month)
              avgQuotaMinute.push(el.avgQuotaMinute)
            })
            const option = {
              color: ['#027DB4'],
              title: {
                text: '',
                subtext: '',
                left: 'center'
              },
              tooltip: {
                trigger: 'axis',
                axisPointer: {
                  type: 'shadow'
                }
              },
              legend: {
                show: false
              },
              xAxis: {
                type: 'category',
                axisTick: {
                  alignWithLabel: true
                },
                data: timeLine
              },
              yAxis: {
                name: '分钟',
                type: 'value'
              },
              series: [{
                // name: '总数',
                type: 'bar',
                barWidth: 20,
                label: {
                  show: true,
                  position: 'top'
                },
                data: avgQuotaMinute
              }]
            }
            myChart.setOption(option)
          } else {
            myChart.showLoading({
              text: '暂无数据',
              fontSize: 18,
              left: 'center',
              color: 'transparent', // loading颜色，设置成透明或白色，不然会显示loading状态
              textColor: '#000', // 文字颜色
              maskColor: 'rgba(255, 255, 255, 0)' // 背景色
            })
          }
        }
      })
    },
    StrokeGetD2CTReportTime() {
      const chartDom = document.getElementById('getD2CTReportTime')
      const myChart = echarts.init(chartDom)
      myChart.clear()
      myChart.hideLoading()
      window.addEventListener('resize', myChart.resize)
      getD2CTReportTime({
        hospitalId: this.$store.getters.hospitalId,
        year: this.year,
        quarter: this.quarter,
        month: this.month,
        startTime: this.monthRange.length > 0 ? this.monthRange[0] : '',
        endTime: this.monthRange.length > 0 ? this.monthRange[1] : '',
        departmentName: this.dept,
        doctorName: this.doc
      }).then(res => {
        if (res.code !== 0) {
          this.notHaveData(myChart)
          return
        }
        console.log(res)
        if (res.data) {
          const timeLine = []
          const avgQuotaMinute = []
          if (res.data.AvgQuotaMinutes && res.data.AvgQuotaMinutes.length !== 0) {
            res.data.AvgQuotaMinutes.forEach(el => {
              timeLine.push(el.year + '-' + el.month)
              avgQuotaMinute.push(el.avgQuotaMinute)
            })
            const option = {
              color: ['#027DB4'],
              title: {
                text: '',
                subtext: '',
                left: 'center'
              },
              tooltip: {
                trigger: 'axis',
                axisPointer: {
                  type: 'shadow'
                }
              },
              legend: {
                show: false
              },
              xAxis: {
                type: 'category',
                axisTick: {
                  alignWithLabel: true
                },
                data: timeLine
              },
              yAxis: {
                name: '分钟',
                type: 'value'
              },
              series: [{
                // name: '总数',
                type: 'bar',
                barWidth: 20,
                label: {
                  show: true,
                  position: 'top'
                },
                data: avgQuotaMinute
              }]
            }
            myChart.setOption(option)
          } else {
            myChart.showLoading({
              text: '暂无数据',
              fontSize: 18,
              left: 'center',
              color: 'transparent', // loading颜色，设置成透明或白色，不然会显示loading状态
              textColor: '#000', // 文字颜色
              maskColor: 'rgba(255, 255, 255, 0)' // 背景色
            })
          }
        }
      })
    },
    StrokeGetThromTalk2SignTime() {
      const chartDom = document.getElementById('getThromTalk2SignTime')
      const myChart = echarts.init(chartDom)
      myChart.clear()
      myChart.hideLoading()
      window.addEventListener('resize', myChart.resize)
      getThromTalk2SignTime({
        hospitalId: this.$store.getters.hospitalId,
        year: this.year,
        quarter: this.quarter,
        month: this.month,
        startTime: this.monthRange.length > 0 ? this.monthRange[0] : '',
        endTime: this.monthRange.length > 0 ? this.monthRange[1] : '',
        departmentName: this.dept,
        doctorName: this.doc
      }).then(res => {
        if (res.code !== 0) {
          this.notHaveData(myChart)
          return
        }
        console.log(res)
        if (res.data) {
          const timeLine = []
          const avgQuotaMinute = []
          if (res.data.AvgQuotaMinutes && res.data.AvgQuotaMinutes.length !== 0) {
            res.data.AvgQuotaMinutes.forEach(el => {
              timeLine.push(el.year + '-' + el.month)
              avgQuotaMinute.push(el.avgQuotaMinute)
            })
            const option = {
              color: ['#027DB4'],
              title: {
                text: '',
                subtext: '',
                left: 'center'
              },
              tooltip: {
                trigger: 'axis',
                axisPointer: {
                  type: 'shadow'
                }
              },
              legend: {
                show: false
              },
              xAxis: {
                type: 'category',
                axisTick: {
                  alignWithLabel: true
                },
                data: timeLine
              },
              yAxis: {
                name: '分钟',
                type: 'value'
              },
              series: [{
                // name: '总数',
                type: 'bar',
                barWidth: 20,
                label: {
                  show: true,
                  position: 'top'
                },
                data: avgQuotaMinute
              }]
            }
            myChart.setOption(option)
          } else {
            myChart.showLoading({
              text: '暂无数据',
              fontSize: 18,
              left: 'center',
              color: 'transparent', // loading颜色，设置成透明或白色，不然会显示loading状态
              textColor: '#000', // 文字颜色
              maskColor: 'rgba(255, 255, 255, 0)' // 背景色
            })
          }
        }
      })
    },
    StrokeGetCTReport2ThromTime() {
      const chartDom = document.getElementById('getCTReport2ThromTime')
      const myChart = echarts.init(chartDom)
      myChart.clear()
      myChart.hideLoading()
      window.addEventListener('resize', myChart.resize)
      getCTReport2ThromTime({
        hospitalId: this.$store.getters.hospitalId,
        year: this.year,
        quarter: this.quarter,
        month: this.month,
        startTime: this.monthRange.length > 0 ? this.monthRange[0] : '',
        endTime: this.monthRange.length > 0 ? this.monthRange[1] : '',
        departmentName: this.dept,
        doctorName: this.doc
      }).then(res => {
        if (res.code !== 0) {
          this.notHaveData(myChart)
          return
        }
        console.log(res)
        if (res.data) {
          const timeLine = []
          const avgQuotaMinute = []
          if (res.data.AvgQuotaMinutes && res.data.AvgQuotaMinutes.length !== 0) {
            res.data.AvgQuotaMinutes.forEach(el => {
              timeLine.push(el.year + '-' + el.month)
              avgQuotaMinute.push(el.avgQuotaMinute)
            })
            const option = {
              color: ['#027DB4'],
              title: {
                text: '',
                subtext: '',
                left: 'center'
              },
              tooltip: {
                trigger: 'axis',
                axisPointer: {
                  type: 'shadow'
                }
              },
              legend: {
                show: false
              },
              xAxis: {
                type: 'category',
                axisTick: {
                  alignWithLabel: true
                },
                data: timeLine
              },
              yAxis: {
                name: '分钟',
                type: 'value'
              },
              series: [{
                // name: '总数',
                type: 'bar',
                barWidth: 20,
                label: {
                  show: true,
                  position: 'top'
                },
                data: avgQuotaMinute
              }]
            }
            myChart.setOption(option)
          } else {
            this.notHaveData(myChart)
          }
        }
      })
    },
    StrokeGetDRT() {
      const chartDom = document.getElementById('getDRT')
      const myChart = echarts.init(chartDom)
      myChart.clear()
      myChart.hideLoading()
      window.addEventListener('resize', myChart.resize)
      getDRT({
        hospitalId: this.$store.getters.hospitalId,
        year: this.year,
        quarter: this.quarter,
        month: this.month,
        startTime: this.monthRange.length > 0 ? this.monthRange[0] : '',
        endTime: this.monthRange.length > 0 ? this.monthRange[1] : '',
        departmentName: this.dept,
        doctorName: this.doc
      }).then(res => {
        if (res.code !== 0) {
          this.notHaveData(myChart)
          return
        }
        console.log(res)
        if (res.data) {
          const timeLine = []
          const avgQuotaMinute = []
          if (res.data.AvgQuotaMinutes && res.data.AvgQuotaMinutes.length !== 0) {
            res.data.AvgQuotaMinutes.forEach(el => {
              timeLine.push(el.year + '-' + el.month)
              avgQuotaMinute.push(el.avgQuotaMinute)
            })
            const option = {
              color: ['#027DB4'],
              title: {
                text: '',
                subtext: '',
                left: 'center'
              },
              tooltip: {
                trigger: 'axis',
                axisPointer: {
                  type: 'shadow'
                }
              },
              legend: {
                show: false
              },
              xAxis: {
                type: 'category',
                axisTick: {
                  alignWithLabel: true
                },
                data: timeLine
              },
              yAxis: {
                name: '分钟',
                type: 'value'
              },
              series: [{
                // name: '总数',
                type: 'bar',
                barWidth: 20,
                label: {
                  show: true,
                  position: 'top'
                },
                data: avgQuotaMinute
              }]
            }
            myChart.setOption(option)
          } else {
            this.notHaveData(myChart)
          }
        }
      })
    },
    StrokeGetSurgeryNum() {
      const chartDom = document.getElementById('getSurgeryNum')
      const myChart = echarts.init(chartDom)
      myChart.clear()
      myChart.hideLoading()
      window.addEventListener('resize', myChart.resize)
      getSurgeryNum({
        hospitalId: this.$store.getters.hospitalId,
        year: this.year,
        quarter: this.quarter,
        month: this.month,
        startTime: this.monthRange.length > 0 ? this.monthRange[0] : '',
        endTime: this.monthRange.length > 0 ? this.monthRange[1] : '',
        departmentName: this.dept,
        doctorName: this.doc
      }).then(res => {
        if (res.code !== 0) {
          this.notHaveData(myChart)
          return
        }
        console.log(res)
        if (res.data) {
          if (!res.data.surgeryNums || res.data.surgeryNums.length === 0) {
            this.notHaveData(myChart)
            return
          }
          const timeLine = []
          this.sum_subtotalSurgeryNum = res.data.total
          const throm = res.data.subtotalSurgeryNum.throm
          const intervention = res.data.subtotalSurgeryNum.intervention
          const hemorrhage = res.data.subtotalSurgeryNum.hemorrhage
          const aneurysm = res.data.subtotalSurgeryNum.aneurysm
          const ceaCas = res.data.subtotalSurgeryNum.ceaCas

          const throm_rate = res.data.surgeryPercentage.throm
          const intervention_rate = res.data.surgeryPercentage.intervention
          const hemorrhage_rate = res.data.surgeryPercentage.hemorrhage
          const aneurysm_rate = res.data.surgeryPercentage.aneurysm
          const ceaCas_rate = res.data.surgeryPercentage.ceaCas

          const throm_list = []
          const intervention_list = []
          const hemorrhage_list = []
          const aneurysm_list = []
          const ceaCas_list = []
          res.data.surgeryNums.forEach(el => {
            timeLine.push(el.year + '-' + el.month)
            throm_list.push(el.numThrom)
            intervention_list.push(el.numIntervention)
            hemorrhage_list.push(el.numHemorrhage)
            aneurysm_list.push(el.numAneurysm)
            ceaCas_list.push(el.numCeaCas)
          })
          const legendList = [{
            name: 'AIS静脉溶栓例数',
            value: throm,
            rate: throm_rate
          }, {
            name: '颅内动脉瘤手术例数',
            value: aneurysm,
            rate: aneurysm_rate
          }, {
            name: 'AIS血管内治疗例数',
            value: intervention,
            rate: intervention_rate
          }, {
            name: 'CEA/CAS手术例数',
            value: ceaCas,
            rate: ceaCas_rate
          }, {
            name: '脑出血手术例数',
            value: hemorrhage,
            rate: hemorrhage_rate
          }]
          const option = {
            color: ['#027DB4', '#F59A23', '#E2596A', '#5EAFAF', '#008B8B'],
            title: {
              text: '',
              subtext: '',
              left: 'center'
            },
            tooltip: {
              trigger: 'axis',
              axisPointer: {
                type: 'shadow'
              }
            },
            legend: {
              // orient: 'vertical',
              // right: 0,
              top: '20px',
              formatter: name => {
                const legendData = legendList.filter(item => {
                  return item.name == name
                })
                return legendData[0].name + '：' + legendData[0].value + '例' + ' ' + legendData[0].rate + '%'
              }
            },
            grid: {
              top: 60
            },
            xAxis: {
              type: 'category',
              axisTick: {
                alignWithLabel: true
              },
              data: timeLine
            },
            yAxis: {
              name: '例',
              type: 'value'
            },
            series: [{
              name: 'AIS静脉溶栓例数',
              type: 'bar',
              barWidth: 20,
              label: {
                show: true,
                position: 'top'
              },
              data: throm_list
            }, {
              name: '颅内动脉瘤手术例数',
              type: 'bar',
              barWidth: 20,
              label: {
                show: true,
                position: 'top'
              },
              data: aneurysm_list
            }, {
              name: 'AIS血管内治疗例数',
              type: 'bar',
              barWidth: 20,
              label: {
                show: true,
                position: 'top'
              },
              data: intervention_list
            }, {
              name: 'CEA/CAS手术例数',
              type: 'bar',
              barWidth: 20,
              label: {
                show: true,
                position: 'top'
              },
              data: ceaCas_list
            }, {
              name: '脑出血手术例数',
              type: 'bar',
              barWidth: 20,
              label: {
                show: true,
                position: 'top'
              },
              data: hemorrhage_list
            }
            ]
          }
          myChart.setOption(option)
        } else {
          this.notHaveData(myChart)
        }
      })
    },
    StrokeGetCeaCasSurgeryModeNum() {
      const chartDom = document.getElementById('getCeaCasSurgeryModeNum')
      const myChart = echarts.init(chartDom)
      myChart.clear()
      myChart.hideLoading()
      window.addEventListener('resize', myChart.resize)
      getCeaCasSurgeryModeNum({
        hospitalId: this.$store.getters.hospitalId,
        year: this.year,
        quarter: this.quarter,
        month: this.month,
        startTime: this.monthRange.length > 0 ? this.monthRange[0] : '',
        endTime: this.monthRange.length > 0 ? this.monthRange[1] : '',
        departmentName: this.dept,
        doctorName: this.doc
      }).then(res => {
        if (res.code !== 0) {
          this.notHaveData(myChart)
          return
        }

        this.ratioCasCea = 0
        const timeLine = []
        const ceaStantard_list = []
        const ceaEversion_list = []
        const cas_list = []
        const composite_list = []
        this.sum_casCea = 0
        console.log(res)
        if (res.data) {
          if (!res.data.ceaCasModeNums || res.data.ceaCasModeNums.length === 0) {
            this.notHaveData(myChart)
            return
          }

          this.sum_casCea = res.data.total
          this.ratioCasCea = res.data.ratioCasCea
          const subtotalCeaCasMode = res.data.subtotalCeaCasMode
          const ceaCasModePercentage = res.data.ceaCasModePercentage

          const ceaStantard = subtotalCeaCasMode.ceaStantard
          const ceaEversion = subtotalCeaCasMode.ceaEversion
          const cas = subtotalCeaCasMode.cas
          const composite = subtotalCeaCasMode.composite

          const ceaStantard_rate = ceaCasModePercentage.ceaStantard
          const ceaEversion_rate = ceaCasModePercentage.ceaEversion
          const cas_rate = ceaCasModePercentage.rate
          const composite_rate = ceaCasModePercentage.rate

          res.data.ceaCasModeNums.forEach(el => {
            timeLine.push(el.year + '-' + el.month)
            ceaStantard_list.push(el.numCeaStantard)
            ceaEversion_list.push(el.numCeaEversion)
            cas_list.push(el.numCas)
            composite_list.push(el.numComposite)
          })
          const legendList = [{
            name: '标准式CEA例数',
            value: ceaStantard,
            rate: ceaStantard_rate
          }, {
            name: '外翻式CEA例数',
            value: ceaEversion,
            rate: ceaEversion_rate
          }, {
            name: 'CAS例数',
            value: cas,
            rate: cas_rate
          }, {
            name: '复合手术例数',
            value: composite,
            rate: composite
          }]
          const option = {
            color: ['#027DB4', '#F59A23', '#E2596A', '#5EAFAF'],
            title: {
              text: '',
              subtext: '',
              left: 'center'
            },
            tooltip: {
              trigger: 'axis',
              axisPointer: {
                type: 'shadow'
              }
            },
            legend: {
              // orient: 'vertical',
              // right: 0,
              top: '20px',
              formatter: name => {
                const legendData = legendList.filter(item => {
                  return item.name == name
                })
                return legendData[0].name + '：' + legendData[0].value + '例' + ' ' + legendData[0].rate + '%'
              }
            },
            grid: {
              top: 60
            },
            xAxis: {
              type: 'category',
              axisTick: {
                alignWithLabel: true
              },
              data: timeLine
            },
            yAxis: {
              name: '例',
              type: 'value'
            },
            series: [{
              name: '标准式CEA例数',
              type: 'bar',
              barWidth: 20,
              label: {
                show: true,
                position: 'top'
              },
              data: ceaStantard_list
            }, {
              name: '外翻式CEA例数',
              type: 'bar',
              barWidth: 20,
              label: {
                show: true,
                position: 'top'
              },
              data: ceaEversion_list
            }, {
              name: 'CAS例数',
              type: 'bar',
              barWidth: 20,
              label: {
                show: true,
                position: 'top'
              },
              data: cas_list
            }, {
              name: '复合手术例数',
              type: 'bar',
              barWidth: 20,
              label: {
                show: true,
                position: 'top'
              },
              data: composite_list
            }]
          }
          myChart.setOption(option)
        } else {
          this.notHaveData(myChart)
        }
      })
    },
    StrokeGetNoThromReasonNum() {
      const chartDom = document.getElementById('getNoThromReasonNum')
      const myChart = echarts.init(chartDom)
      myChart.clear()
      myChart.hideLoading()
      window.addEventListener('resize', myChart.resize)
      getNoThromReasonNum({
        hospitalId: this.$store.getters.hospitalId,
        year: this.year,
        quarter: this.quarter,
        month: this.month,
        startTime: this.monthRange.length > 0 ? this.monthRange[0] : '',
        endTime: this.monthRange.length > 0 ? this.monthRange[1] : '',
        departmentName: this.dept,
        doctorName: this.doc
      }).then(res => {
        if (res.code !== 0) {
          this.notHaveData(myChart)
          return
        }
        let diagMain = []
        let noThromReason1_value = 0
        let noThromReason2_value = 0
        let noThromReason3_value = 0
        let noThromReason4_value = 0
        let noThromReasonOther_value = 0
        let noThromReason1_rate = 0
        let noThromReason2_rate = 0
        let noThromReason3_rate = 0
        let noThromReason4_rate = 0
        let noThromReasonOther_rate = 0
        this.sum_noThromReasonNum = 0

        console.log(res)
        if (res.data) {
          if (!res.data.noThromReasonNum || !res.data.noThromReasonPercentage) {
            this.notHaveData(myChart)
            return
          }
          this.sum_noThromReasonNum = res.data.total
          noThromReason1_value = res.data.noThromReasonNum.noThromReason1 ? res.data.noThromReasonNum.noThromReason1 : 0
          noThromReason2_value = res.data.noThromReasonNum.noThromReason2 ? res.data.noThromReasonNum.noThromReason2 : 0
          noThromReason3_value = res.data.noThromReasonNum.noThromReason3 ? res.data.noThromReasonNum.noThromReason3 : 0
          noThromReason4_value = res.data.noThromReasonNum.noThromReason4 ? res.data.noThromReasonNum.noThromReason4 : 0
          noThromReasonOther_value = res.data.noThromReasonNum.noThromReasonOther ? res.data.noThromReasonNum.noThromReasonOther : 0
          noThromReason1_rate = res.data.noThromReasonPercentage.noThromReason1 ? res.data.noThromReasonPercentage.noThromReason1 : 0
          noThromReason2_rate = res.data.noThromReasonPercentage.noThromReason2 ? res.data.noThromReasonPercentage.noThromReason2 : 0
          noThromReason3_rate = res.data.noThromReasonPercentage.noThromReason3 ? res.data.noThromReasonPercentage.noThromReason3 : 0
          noThromReason4_rate = res.data.noThromReasonPercentage.noThromReason4 ? res.data.noThromReasonPercentage.noThromReason4 : 0
          noThromReasonOther_rate = res.data.noThromReasonPercentage.noThromReasonOther ? res.data.noThromReasonPercentage.noThromReasonOther : 0
          diagMain = [
            { value: noThromReason1_value, name: '超时间窗', rate: noThromReason1_rate },
            { value: noThromReason2_value, name: '禁忌症', rate: noThromReason2_rate },
            { value: noThromReason3_value, name: '患者/家属拒绝', rate: noThromReason3_rate },
            { value: noThromReason4_value, name: '外院溶栓', rate: noThromReason4_rate },
            { value: noThromReasonOther_value, name: '其他', rate: noThromReasonOther_rate }
          ]
          const option = {
            tooltip: {
              trigger: 'item'
            },
            legend: {
              orient: 'vertical',
              left: '30%',
              formatter: name => {
                const nameList = diagMain.filter(item => {
                  return item.name === name
                })
                return nameList[0].name + '：' + nameList[0].value + '例' + ' ' + nameList[0].rate + '%'
              }
            },
            series: [
              {
                // name: 'Access From',
                type: 'pie',
                radius: '50%',
                data: diagMain,
                emphasis: {
                  itemStyle: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                  }
                }
              }
            ]
          }
          myChart.setOption(option)
        } else {
          this.notHaveData(myChart)
        }
      })
    },
    StrokeGetNoIntervReasonNum() {
      const chartDom = document.getElementById('getNoIntervReasonNum')
      const myChart = echarts.init(chartDom)
      myChart.clear()
      myChart.hideLoading()
      window.addEventListener('resize', myChart.resize)
      getNoIntervReasonNum({
        hospitalId: this.$store.getters.hospitalId,
        year: this.year,
        quarter: this.quarter,
        month: this.month,
        startTime: this.monthRange.length > 0 ? this.monthRange[0] : '',
        endTime: this.monthRange.length > 0 ? this.monthRange[1] : '',
        departmentName: this.dept,
        doctorName: this.doc
      }).then(res => {
        if (res.code !== 0) {
          this.notHaveData(myChart)
          return
        }
        let diagMain = []
        let noIntervReason1_value = 0
        let noIntervReason2_value = 0
        let noIntervReason3_value = 0
        let noIntervReason4_value = 0
        let noIntervReasonOther_value = 0
        let noIntervReason1_rate = 0
        let noIntervReason2_rate = 0
        let noIntervReason3_rate = 0
        let noIntervReason4_rate = 0
        let noIntervReasonOther_rate = 0
        this.sum_noIntervReasonNum = 0

        console.log(res)
        if (res.data) {
          if (!res.data.noIntervReasonNum || !res.data.noIntervReasonPercentage) {
            this.notHaveData(myChart)
            return
          }
          this.sum_noIntervReasonNum = res.data.total
          noIntervReason1_value = res.data.noIntervReasonNum.noIntervReason1 ? res.data.noIntervReasonNum.noIntervReason1 : 0
          noIntervReason2_value = res.data.noIntervReasonNum.noIntervReason2 ? res.data.noIntervReasonNum.noIntervReason2 : 0
          noIntervReason3_value = res.data.noIntervReasonNum.noIntervReason3 ? res.data.noIntervReasonNum.noIntervReason3 : 0
          noIntervReason4_value = res.data.noIntervReasonNum.noIntervReason4 ? res.data.noIntervReasonNum.noIntervReason4 : 0
          noIntervReasonOther_value = res.data.noIntervReasonNum.noIntervReasonOther ? res.data.noIntervReasonNum.noIntervReasonOther : 0
          noIntervReason1_rate = res.data.noIntervReasonPercentage.noIntervReason1 ? res.data.noIntervReasonPercentage.noIntervReason1 : 0
          noIntervReason2_rate = res.data.noIntervReasonPercentage.noIntervReason2 ? res.data.noIntervReasonPercentage.noIntervReason2 : 0
          noIntervReason3_rate = res.data.noIntervReasonPercentage.noIntervReason3 ? res.data.noIntervReasonPercentage.noIntervReason3 : 0
          noIntervReason4_rate = res.data.noIntervReasonPercentage.noIntervReason4 ? res.data.noIntervReasonPercentage.noIntervReason4 : 0
          noIntervReasonOther_rate = res.data.noIntervReasonPercentage.noIntervReasonOther ? res.data.noIntervReasonPercentage.noIntervReasonOther : 0
          diagMain = [
            { value: noIntervReason1_value, name: '超时间窗', rate: noIntervReason1_rate },
            { value: noIntervReason2_value, name: '禁忌症', rate: noIntervReason2_rate },
            { value: noIntervReason3_value, name: '患者/家属拒绝', rate: noIntervReason3_rate },
            { value: noIntervReason4_value, name: '非大血管病变', rate: noIntervReason4_rate },
            { value: noIntervReasonOther_value, name: '其他', rate: noIntervReasonOther_rate }
          ]
          let option
          option = {
            tooltip: {
              trigger: 'item'
            },
            legend: {
              orient: 'vertical',
              left: '30%',
              formatter: name => {
                const nameList = diagMain.filter(item => {
                  return item.name === name
                })
                return nameList[0].name + '：' + nameList[0].value + '例' + ' ' + nameList[0].rate + '%'
              }
            },
            series: [
              {
                // name: 'Access From',
                type: 'pie',
                radius: '50%',
                data: diagMain,
                emphasis: {
                  itemStyle: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                  }
                }
              }
            ]
          }
          myChart.setOption(option)
        } else {
          this.notHaveData(myChart)
        }
      })
    }
  }
}
</script>

<style lang="less" scoped>
.treatment-process {
    width: 100%;
    height: 100%;

    &_content {
        height: calc(100% - 59px);
        overflow-y: auto;
    }

    .dignosis-content {
        width: 100%;
        height: 400px;
        display: inline-block;

        .dignosis-style {
            display: inline-block;
            width: 50%;
            height: 100%;
        }
    }

    .treatment-process-card {
        height: 400px;
    }

    .box-card+.box-card {
        margin-top: 5px;
    }

    /deep/.el-radio__label {
        line-height: 38px;
    }
}
</style>
